Skip to content

Conversation

@lucifer4073
Copy link
Contributor

@lucifer4073 lucifer4073 commented Dec 18, 2024

Closes #2117

Key Features:

  • Callable transform: Applies a single transformation to all variables.
    az.plot_forest(data, transform=lambda x: x ** 2)
  • Dictionary transform: Allows variable-specific transformations.
    az.plot_forest(data, transform={"theta": np.exp, "mu": np.log})

Additional Changes:

  • Added test cases to validate the feature.
  • Documentation updated to follow the NumPy style guide.
  • Example script added to demonstrate usage

📚 Documentation preview 📚: https://arviz--2403.org.readthedocs.build/en/2403/

@codecov
Copy link

codecov bot commented Dec 18, 2024

Codecov Report

❌ Patch coverage is 91.66667% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 86.83%. Comparing base (a288d50) to head (c615d9e).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
arviz/plots/forestplot.py 91.66% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2403   +/-   ##
=======================================
  Coverage   86.83%   86.83%           
=======================================
  Files         124      124           
  Lines       13018    13029   +11     
=======================================
+ Hits        11304    11314   +10     
- Misses       1714     1715    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@lucifer4073 lucifer4073 changed the title Fixes #2117: Modified transform parameter in plot_forest to accept dictionary values Modified transform parameter in plot_forest to accept dictionary values Dec 18, 2024
@lucifer4073
Copy link
Contributor Author

Hi @OriolAbril, it would be great if you could review my PR.

@OriolAbril
Copy link
Member

sorry this fell through the cracks @lucifer4073. I will rebase and merge

@OriolAbril OriolAbril merged commit 2ead9f0 into arviz-devs:main Oct 16, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Allow transform to support a dictionary

2 participants